package com.sx.controller;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSON;
import com.annotation.BaseSeverlet;
import com.annotation.MethodAnnotation;
import com.annotation.demo.TestService;
import com.dfec.model.Msg;
import com.dfec.utils.Consists;
import com.dfec.utils.ResponseUtil;
import com.dfec.utils.ResultHandler;
import com.sx.service.WeatherKnowService;

/**
 * Servlet implementation class WeatherKnow
 */
@WebServlet(name = "wns", description = "气象知识及百科服务", urlPatterns = { "/wns" })
public class WeatherKnow extends BaseSeverlet {
	private static final long serialVersionUID = 1L;
	WeatherKnowService  ws=null;
    public WeatherKnow() {
        super();
        // TODO Auto-generated constructor stub
        ws=new WeatherKnowService();
    }

    @MethodAnnotation(method="baike")
    public void baikeList(HttpServletRequest request, HttpServletResponse response){
    	try {
			ResultHandler.handler(request, response, ws.baikeList(request),true);
		} catch (SQLException e) {
			e.printStackTrace();
		}
        	
            
    }
    
    @MethodAnnotation(method="details")
    public void baikeDetails(HttpServletRequest request, HttpServletResponse response){
        	try {
				ResultHandler.handler(request, response, ws.baikeDetails(request),true);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            
    }
    
    
    
    @MethodAnnotation(method="search")
    public void baikeSearch(HttpServletRequest request, HttpServletResponse response) {
    	try {
			ResultHandler.handler(request, response, ws.baikeSearch(request),true);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
            
    }
    
    
    
}
